﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Xml;
using System.Xml.Serialization;

namespace RecursosHumanos
{
    public partial class frmSelecao3C : Form
    {
        public int id;
        public String rotulo;
        public Boolean selecionado = false;

        public frmSelecao3C(object lista)
        {
            InitializeComponent();
            grd.DataSource = lista;
        }

        private void frmFilme_Load(object sender, EventArgs e)
        {
            
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void grd_Click(object sender, EventArgs e)
        {
            try
            {
                //grd.CurrentRow.Cells[0].ToolTipText = FilmeGenero.Find(Convert.ToInt32(grd.CurrentRow.Cells["genero"].Value.ToString()));
            }
            catch { }
        }

        private void grd_DoubleClick(object sender, EventArgs e)
        {
            Selecionar();
        }

        private void Selecionar()
        {
            try
            {
                id = Convert.ToInt32(grd.CurrentRow.Cells[0].Value);
                rotulo = grd.CurrentRow.Cells[1].Value.ToString();
                selecionado = true;
            }
            catch
            {
                MessageBox.Show("Problemas ao carregar o registro selecionado.");
            }
            this.Close();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            Selecionar();
        }
    }
}
